package cn.kwq.project_manger.utils;

import cn.kwq.project_manger.pojo.QProject;
import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
public class S3TypeUtil {


    public String getContentType(String suffix){
     return switch ("." + suffix) {
      case ".*" -> "application/octet-stream";
      case ".001" -> "application/x-001";
      case ".301" -> "application/x-301";
      case ".323" -> "text/h323";
      case ".906" -> "application/x-906";
      case ".907" -> "drawing/907";
      case ".a11" -> "application/x-a11";
      case ".acp" -> "audio/x-mei-aac";
      case ".ai" -> "application/postscript";
      case ".aif" -> "audio/aiff";
      case ".aifc" -> "audio/aiff";
      case ".aiff" -> "audio/aiff";
      case ".anv" -> "application/x-anv";
      case ".asa" -> "text/asa";
      case ".asf" -> "video/x-ms-asf";
      case ".asp" -> "text/asp";
      case ".asx" -> "video/x-ms-asf";
      case ".au" -> "audio/basic";
      case ".avi" -> "video/avi";
      case ".awf" -> "application/vnd.adobe.workflow";
      case ".biz" -> "text/xml";
      case ".bmp" -> "application/x-bmp";
      case ".bot" -> "application/x-bot";
      case ".c4t" -> "application/x-c4t";
      case ".c90" -> "application/x-c90";
      case ".cal" -> "application/x-cals";
      case ".cat" -> "application/s-pki.seccat";
      case ".cdf" -> "application/x-netcdf";
      case ".cdr" -> "application/x-cdr";
      case ".cel" -> "application/x-cel";
      case ".cer" -> "application/x-x509-ca-cert";
      case ".cg4" -> "application/x-g4";
      case ".cgm" -> "application/x-cgm";
      case ".cit" -> "application/x-cit";
      case ".class" -> "java/*";
      case ".cml" -> "text/xml";
      case ".cmp" -> "application/x-cmp";
      case ".cmx" -> "application/x-cmx";
      case ".cot" -> "application/x-cot";
      case ".crl" -> "application/pkix-crl";
      case ".crt" -> "application/x-x509-ca-cert";
      case ".csi" -> "application/x-csi";
      case ".css" -> "text/css";
      case ".cut" -> "application/x-cut";
      case ".dbf" -> "application/x-dbf";
      case ".dbm" -> "application/x-dbm";
      case ".dbx" -> "application/x-dbx";
      case ".dcd" -> "text/xml";
      case ".dcx" -> "application/x-dcx";
      case ".der" -> "application/x-x509-ca-cert";
      case ".dgn" -> "application/x-dgn";
      case ".dib" -> "application/x-dib";
      case ".dll" -> "application/x-msdownload";
      case ".doc" -> "application/msword";
      case ".dot" -> "application/msword";
      case ".drw" -> "application/x-drw";
      case ".dtd" -> "text/xml";
      case ".dwf" -> "Model/vnd.dwf";
      case ".dwg" -> "application/x-dwg";
      case ".dxb" -> "application/x-dxb";
      case ".dxf" -> "application/x-dxf";
      case ".edn" -> "application/vnd.adobe.edn";
      case ".emf" -> "application/x-emf";
      case ".eml" -> "message/rfc822";
      case ".ent" -> "text/xml";
      case ".epi" -> "application/x-epi";
      case ".eps" -> "application/x-ps";
      case ".etd" -> "application/x-ebx";
      case ".exe" -> "application/x-msdownload";
      case ".fax" -> "image/fax";
      case ".fdf" -> "application/vnd.fdf";
      case ".fif" -> "application/fractals";
      case ".fo" -> "text/xml";
      case ".frm" -> "application/x-frm";
      case ".g4" -> "application/x-g4";
      case ".gbr" -> "application/x-gbr";
      case ".gcd" -> "application/x-gcd";
      case ".gif" -> "image/gif";
      case ".gl2" -> "application/x-gl2";
      case ".gp4" -> "application/x-gp4";
      case ".hgl" -> "application/x-hgl";
      case ".hmr" -> "application/x-hmr";
      case ".hpg" -> "application/x-hpgl";
      case ".hpl" -> "application/x-hpl";
      case ".hqx" -> "application/mac-binhex40";
      case ".hrf" -> "application/x-hrf";
      case ".hta" -> "application/hta";
      case ".htc" -> "text/x-component";
      case ".htm" -> "text/html";
      case ".html" -> "text/html";
      case ".htt" -> "text/webviewhtml";
      case ".htx" -> "text/html";
      case ".icb" -> "application/x-icb";
      case ".ico" -> "image/x-icon";
      case ".iff" -> "application/x-iff";
      case ".ig4" -> "application/x-g4";
      case ".igs" -> "application/x-igs";
      case ".iii" -> "application/x-iphone";
      case ".img" -> "application/x-img";
      case ".ins" -> "application/x-internet-signup";
      case ".isp" -> "application/x-internet-signup";
      case ".IVF" -> "video/x-ivf";
      case ".java" -> "java/*";
      case ".jfif" -> "image/jpeg";
      case ".jpe" -> "image/jpeg";
      case ".jpeg" -> "image/jpeg";
      case ".jpg" -> "image/jpeg";
      case ".js" -> "application/x-javascript";
      case ".jsp" -> "text/html";
      case ".la1" -> "audio/x-liquid-file";
      case ".lar" -> "application/x-laplayer-reg";
      case ".latex" -> "application/x-latex";
      case ".lavs" -> "audio/x-liquid-secure";
      case ".lbm" -> "application/x-lbm";
      case ".lmsff" -> "audio/x-la-lms";
      case ".ls" -> "application/x-javascript";
      case ".ltr" -> "application/x-ltr";
      case ".m1v" -> "video/x-mpeg";
      case ".m2v" -> "video/x-mpeg";
      case ".m3u" -> "audio/mpegurl";
      case ".m4e" -> "video/mpeg4";
      case ".mac" -> "application/x-mac";
      case ".man" -> "application/x-troff-man";
      case ".math" -> "text/xml";
      case ".mdb" -> "application/x-mdb";
      case ".mfp" -> "application/x-shockwave-flash";
      case ".mht" -> "message/rfc822";
      case ".mhtml" -> "message/rfc822";
      case ".mi" -> "application/x-mi";
      case ".mid" -> "audio/mid";
      case ".midi" -> "audio/mid";
      case ".mil" -> "application/x-mil";
      case ".mml" -> "text/xml";
      case ".mnd" -> "audio/x-musicnet-download";
      case ".mns" -> "audio/x-musicnet-stream";
      case ".mocha" -> "application/x-javascript";
      case ".movie" -> "video/x-sgi-movie";
      case ".mp1" -> "audio/mp1";
      case ".mp2" -> "audio/mp2";
      case ".mp2v" -> "video/mpeg";
      case ".mp3" -> "audio/mp3";
      case ".mp4" -> "video/mp4";
      case ".mpa" -> "video/x-mpg";
      case ".mpd" -> "application/-project";
      case ".mpe" -> "video/x-mpeg";
      case ".mpeg" -> "video/mpg";
      case ".mpg" -> "video/mpg";
      case ".mpga" -> "audio/rn-mpeg";
      case ".mpp" -> "application/-project";
      case ".mps" -> "video/x-mpeg";
      case ".mpt" -> "application/-project";
      case ".mpv" -> "video/mpg";
      case ".mpv2" -> "video/mpeg";
      case ".mpw" -> "application/s-project";
      case ".mpx" -> "application/-project";
      case ".mtx" -> "text/xml";
      case ".mxp" -> "application/x-mmxp";
      case ".net" -> "image/pnetvue";
      case ".nrf" -> "application/x-nrf";
      case ".nws" -> "message/rfc822";
      case ".odc" -> "text/x-ms-odc";
      case ".out" -> "application/x-out";
      case ".p10" -> "application/pkcs10";
      case ".p12" -> "application/x-pkcs12";
      case ".p7b" -> "application/x-pkcs7-certificates";
      case ".p7c" -> "application/pkcs7-mime";
      case ".p7m" -> "application/pkcs7-mime";
      case ".p7r" -> "application/x-pkcs7-certreqresp";
      case ".p7s" -> "application/pkcs7-signature";
      case ".pc5" -> "application/x-pc5";
      case ".pci" -> "application/x-pci";
      case ".pcl" -> "application/x-pcl";
      case ".pcx" -> "application/x-pcx";
      case ".pdf" -> "application/pdf";
      case ".pdx" -> "application/vnd.adobe.pdx";
      case ".pfx" -> "application/x-pkcs12";
      case ".pgl" -> "application/x-pgl";
      case ".pic" -> "application/x-pic";
      case ".pko" -> "application-pki.pko";
      case ".pl" -> "application/x-perl";
      case ".plg" -> "text/html";
      case ".pls" -> "audio/scpls";
      case ".plt" -> "application/x-plt";
      case ".png" -> "image/png";
      case ".pot" -> "applications-powerpoint";
      case ".ppa" -> "application/vs-powerpoint";
      case ".ppm" -> "application/x-ppm";
      case ".pps" -> "application-powerpoint";
      case ".ppt" -> "applications-powerpoint";
      case ".pr" -> "application/x-pr";
      case ".prf" -> "application/pics-rules";
      case ".prn" -> "application/x-prn";
      case ".prt" -> "application/x-prt";
      case ".ps" -> "application/postscript";
      case ".ptn" -> "application/x-ptn";
      case ".pwz" -> "application/powerpoint";
      case ".r3t" -> "text/vnd.rn-realtext3d";
      case ".ra" -> "audio/vnd.rn-realaudio";
      case ".ram" -> "audio/x-pn-realaudio";
      case ".ras" -> "application/x-ras";
      case ".rat" -> "application/rat-file";
      case ".rdf" -> "text/xml";
      case ".rec" -> "application/vnd.rn-recording";
      case ".red" -> "application/x-red";
      case ".rgb" -> "application/x-rgb";
      case ".rjs" -> "application/vnd.rn-realsystem-rjs";
      case ".rjt" -> "application/vnd.rn-realsystem-rjt";
      case ".rlc" -> "application/x-rlc";
      case ".rle" -> "application/x-rle";
      case ".rm" -> "application/vnd.rn-realmedia";
      case ".rmf" -> "application/vnd.adobe.rmf";
      case ".rmi" -> "audio/mid";
      case ".rmj" -> "application/vnd.rn-realsystem-rmj";
      case ".rmm" -> "audio/x-pn-realaudio";
      case ".rmp" -> "application/vnd.rn-rn_music_package";
      case ".rms" -> "application/vnd.rn-realmedia-secure";
      case ".rmvb" -> "application/vnd.rn-realmedia-vbr";
      case ".rmx" -> "application/vnd.rn-realsystem-rmx";
      case ".rnx" -> "application/vnd.rn-realplayer";
      case ".rp" -> "image/vnd.rn-realpix";
      case ".rpm" -> "audio/x-pn-realaudio-plugin";
      case ".rsml" -> "application/vnd.rn-rsml";
      case ".rt" -> "text/vnd.rn-realtext";
      case ".rtf" -> "application/x-rtf";
      case ".rv" -> "video/vnd.rn-realvideo";
      case ".sam" -> "application/x-sam";
      case ".sat" -> "application/x-sat";
      case ".sdp" -> "application/sdp";
      case ".sdw" -> "application/x-sdw";
      case ".sit" -> "application/x-stuffit";
      case ".slb" -> "application/x-slb";
      case ".sld" -> "application/x-sld";
      case ".slk" -> "drawing/x-slk";
      case ".smi" -> "application/smil";
      case ".smil" -> "application/smil";
      case ".smk" -> "application/x-smk";
      case ".snd" -> "audio/basic";
      case ".sol" -> "text/plain";
      case ".sor" -> "text/plain";
      case ".spc" -> "application/x-pkcs7-certificates";
      case ".spl" -> "application/futuresplash";
      case ".spp" -> "text/xml";
      case ".ssm" -> "application/streamingmedia";
      case ".sst" -> "application-pki.certstore";
      case ".stl" -> "application/-pki.stl";
      case ".stm" -> "text/html";
      case ".sty" -> "application/x-sty";
      case ".svg" -> "text/xml";
      case ".swf" -> "application/x-shockwave-flash";
      case ".tdf" -> "application/x-tdf";
      case ".tg4" -> "application/x-tg4";
      case ".tga" -> "application/x-tga";
      case ".tif" -> "image/tiff";
      case ".tiff" -> "image/tiff";
      case ".tld" -> "text/xml";
      case ".top" -> "drawing/x-top";
      case ".torrent" -> "application/x-bittorrent";
      case ".tsd" -> "text/xml";
      case ".txt" -> "text/plain";
      case ".uin" -> "application/x-icq";
      case ".uls" -> "text/iuls";
      case ".vcf" -> "text/x-vcard";
      case ".vda" -> "application/x-vda";
      case ".vdx" -> "application/vnd.visio";
      case ".vml" -> "text/xml";
      case ".vpg" -> "application/x-vpeg005";
      case ".vsd" -> "application/x-vsd";
      case ".vss" -> "application/vnd.visio";
      case ".vst" -> "application/x-vst";
      case ".vsw" -> "application/vnd.visio";
      case ".vsx" -> "application/vnd.visio";
      case ".vtx" -> "application/vnd.visio";
      case ".vxml" -> "text/xml";
      case ".wav" -> "audio/wav";
      case ".wax" -> "audio/x-ms-wax";
      case ".wb1" -> "application/x-wb1";
      case ".wb2" -> "application/x-wb2";
      case ".wb3" -> "application/x-wb3";
      case ".wbmp" -> "image/vnd.wap.wbmp";
      case ".wiz" -> "application/msword";
      case ".wk3" -> "application/x-wk3";
      case ".wk4" -> "application/x-wk4";
      case ".wkq" -> "application/x-wkq";
      case ".wks" -> "application/x-wks";
      case ".wm" -> "video/x-ms-wm";
      case ".wma" -> "audio/x-ms-wma";
      case ".wmd" -> "application/x-ms-wmd";
      case ".wmf" -> "application/x-wmf";
      case ".wml" -> "text/vnd.wap.wml";
      case ".wmv" -> "video/x-ms-wmv";
      case ".wmx" -> "video/x-ms-wmx";
      case ".wmz" -> "application/x-ms-wmz";
      case ".wp6" -> "application/x-wp6";
      case ".wpd" -> "application/x-wpd";
      case ".wpg" -> "application/x-wpg";
      case ".wpl" -> "application/-wpl";
      case ".wq1" -> "application/x-wq1";
      case ".wr1" -> "application/x-wr1";
      case ".wri" -> "application/x-wri";
      case ".wrk" -> "application/x-wrk";
      case ".ws" -> "application/x-ws";
      case ".ws2" -> "application/x-ws";
      case ".wsc" -> "text/scriptlet";
      case ".wsdl" -> "text/xml";
      case ".wvx" -> "video/x-ms-wvx";
      case ".xdp" -> "application/vnd.adobe.xdp";
      case ".xdr" -> "text/xml";
      case ".xfd" -> "application/vnd.adobe.xfd";
      case ".xfdf" -> "application/vnd.adobe.xfdf";
      case ".xhtml" -> "text/html";
      case ".xls" -> "application/x-xls";
      case ".xlw" -> "application/x-xlw";
      case ".xml" -> "text/xml";
      case ".xpl" -> "audio/scpls";
      case ".xq" -> "text/xml";
      case ".xql" -> "text/xml";
      case ".xquery" -> "text/xml";
      case ".xsd" -> "text/xml";
      case ".xsl" -> "text/xml";
      case ".xslt" -> "text/xml";
      case ".xwd" -> "application/x-xwd";
      case ".x_b" -> "application/x-x_b";
      case ".x_t" -> "application/x-x_t";
      default -> "application/octet-stream";
     };
    }
}
